<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet"
		href="${request.contextPath}/resources/css/styleButton.css"
		type="text/css" media="screen" />
	<style type="text/css">
.ui-layout-north {
	z-index: 20 !important;
	overflow: visible !important;;
}

.ui-layout-north .ui-layout-unit-content {
	overflow: visible !important;
}
</style>
</h:head>
<h:body>
	<ui:composition>
		<p>
			<ui:insert name="main">
				<h:form id="form">
					<p:layout
						style="min-width:400px;min-height:600px; max-height:600px;"
						id="layout">

						<p:layoutUnit id="left" position="west" size="300"
							resizable="true" closable="true" collapsible="true"
							header="Options" minSize="200">
							<p:accordionPanel>
								<p:tab title="Calender">
									<br />
									<p:calendar mode="inline" navigator="none" />
									<br />
								</p:tab>

								<p:tab
									title="#{userLoginBean.user.student.name} #{userLoginBean.user.student.surname}"
									rendered="#{userLoginBean.user.roles.tab_student}">
									<p:commandLink id="myTeacher" value="Show Teacher" onclick="dialogTeacher.show();" action="#{studentLessonController.myLessonList}" type="button"
										style="margin-top:10px" />
									<br />
									<p:commandLink id="myLesson" value="Show MyLesson"
										onclick="dialogMyLessons.show();" type="button"
										style="margin-top:10px" />
								</p:tab>

								<p:tab
									title="#{userLoginBean.user.teacher.name} #{userLoginBean.user.teacher.surname}"
									rendered="#{userLoginBean.user.roles.tab_teacher}">

								</p:tab>

								<p:tab
									title="#{userLoginBean.user.admin.name} #{userLoginBean.user.admin.surname}"
									rendered="#{userLoginBean.user.roles.tab_admin}">

								</p:tab>
							</p:accordionPanel>
						</p:layoutUnit>

						<p:layoutUnit id="right" position="east" size="250"
							header="Gallery" resizable="true" closable="true"
							collapsible="false" style="text-align:center">

							<p:lightBox style="text-align:center;margin-top:20px;">

								<h:outputLink
									value="#{request.contextPath}/resources/img/travel.png"
									title="Travel " style="margin-bottom:200px;">
									<h:graphicImage value="/resources/img/travel.png" width="30px;"
										height="30px;" />
								</h:outputLink>
							</p:lightBox>
							<p:commandButton id="basic" value="Basic One"
								onclick="basicdialog.show();" type="button"
								style="margin-top:10px" />
						</p:layoutUnit>

						<p:layoutUnit id="center" position="center">

							<div id="container">
								<h:form id="container">
									<p:tabView>
										<p:tab title="Menu">
											<h:form id="admin"
												rendered="#{userLoginBean.user.roles.panel_admin}">
												<p:fieldset styleClass="fieldset"
													legend="#{userLoginBean.user.roles.description} STATUS">
													<h:panelGrid id="loginPanelGrid" cellspacing="8"
														columns="2" styleClass="panel_back2">
														<h:outputText style="text-align: center"
															value="#{userLoginBean.user.admin.name} #{userLoginBean.user.admin.surname}" />
														<h:outputLabel value="" />
														<p:separator id="separator" />
														<h:outputLabel value="" />
														<h:outputText style="text-align: center"
															value="#{userLoginBean.user.user_number}" />
														<br />
													</h:panelGrid>
												</p:fieldset>
											</h:form>
											<h:form id="teacher"
												rendered="#{userLoginBean.user.roles.panel_teacher}">
												<p:fieldset styleClass="fieldset"
													legend="#{userLoginBean.user.roles.description} STATUS">
													<h:panelGrid id="loginPanelGrid" cellspacing="8"
														columns="2" styleClass="panel_back2">
														<h:outputText style="text-align: center"
															value="#{userLoginBean.user.teacher.name} #{userLoginBean.user.teacher.surname}" />
														<h:outputLabel value="" />
														<p:separator id="separator" />
														<h:outputLabel value="" />
														<h:outputText style="text-align: center"
															value="#{userLoginBean.user.user_number}" />
													</h:panelGrid>
												</p:fieldset>
											</h:form>
											<h:form id="student"
												rendered="#{userLoginBean.user.roles.panel_student}">
												<p:fieldset styleClass="fieldset"
													legend="#{userLoginBean.user.roles.description} STATUS">
													<h:panelGrid id="loginPanelGrid" cellspacing="8"
														columns="2" styleClass="panel_back2">

														<h:panelGrid columns="1"
															style="width:100%; text-align: center">
															<p:graphicImage value="/resources/img/student.png" />
														</h:panelGrid>
														<h:outputLabel value="" />

														<h:outputText style="text-align: center"
															value="#{userLoginBean.user.student.name} #{userLoginBean.user.student.surname} || #{userLoginBean.user.sciency.sciency_name}" />
														<h:outputLabel value="" />
														<p:separator id="separator" />
														<h:outputLabel value="" />
														<h:outputText style="text-align: center" value="#{userLoginBean.user.user_number}" />
													</h:panelGrid>
												</p:fieldset>
											</h:form>
										</p:tab>

										<p:tab title="Announcements">
											<h:outputText value="Announcements" />
											<br />
											<h:outputText style="text-align: center"
												value="#{userController.user.user_id}" />
											<h:outputText style="text-align: center"
												value="#{userLoginBean.user.student.studentLessons}" />
											<h:outputText style="text-align: center"
												value="#{userLoginBean.user.user_id}" />

										</p:tab>

										<p:tab title="Documnet">
											<p:media value="/resources/other/guide.pdf" width="100%"
												height="300px">
												<h:outputLink
													value="/resources/other/spring-webflow-reference.pdf">click</h:outputLink>
											</p:media>
										</p:tab>

										<p:tab title="Videos">
											<p:media
												value="http://vimeo.com/moogaloop.swf?clip_id=12440890"
												width="600" height="400" player="flash" />
										</p:tab>
									</p:tabView>
								</h:form>
							</div>
						</p:layoutUnit>
					</p:layout>

					<h:form id="formListTeacher">
						<p:dialog header="Teacher Dialog" widgetVar="dialogTeacher"
							modal="true" showEffect="explode" hideEffect="explode"
							width="70%" styleClass="panel_back2">
							<p:dataTable id="listDatatable" var="teacherList"
								value="#{teacherController.teacherList}"
								style="width:99%; padding-top: 1px; padding-bottom: 1px;  vertical-align: top;"
								paginator="true" rows="12"
								paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								paginatorPosition="bottom" rowsPerPageTemplate="6,12,24"
								selection="#{teacherController.teacher}"
								rowKey="#{teacherList.userTeacher.user_number}"
								selectionMode="single" widgetVar="teacherTable"
								emptyMessage="No teacher found with given criteria"
								filteredValue="#{teacherController.filterTeacher}"
								draggableColumns="false" resizableColumns="true">
								<p:ajax event="rowSelect"
									listener="#{teacherController.onRowSelect}"
									update=":#{p:component('panelGrid')}"
									oncomplete="teacherDialog.show()" />

								<p:column headerText="NAME" sortBy="#{teacherList.name}"
									filterBy="#{teacherList.name}">
									<h:outputText value="#{teacherList.name}" />
								</p:column>

								<p:column headerText="SURNAME" sortBy="#{teacherList.surname}">
									<h:outputText value="#{teacherList.surname}" />
								</p:column>

								<p:column headerText="GENDER">
									<h:outputText value="#{teacherList.userTeacher.sex}" />
								</p:column>


							</p:dataTable>
						</p:dialog>

						<p:dialog header="Teacher Detail" widgetVar="teacherDialog"
							resizable="false" showEffect="explode" hideEffect="explode"
							styleClass="dialogback">
							<h:panelGrid id="panelGrid" columns="2" cellpadding="4">

								<f:facet name="header">
									<h:outputText
										value="#{teacherController.teacher.name}  #{teacherController.teacher.surname}"
										style="font-weight:bold" />
								</f:facet>

								<h:panelGroup>
									<h:outputText value="Teacher Number  " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText
									value="#{teacherController.teacher.userTeacher.user_number}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="Gender " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText
									value="#{teacherController.teacher.userTeacher.sex}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="Birth Date " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText value="#{teacherController.teacher.birth_date}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="E-Mail " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText value="#{teacherController.teacher.email}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="Tel Number " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText value="#{teacherController.teacher.tel_number}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="City " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText
									value="#{teacherController.teacher.userTeacher.address.city}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="Address Detail " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText
									value="#{teacherController.teacher.userTeacher.address.address_detail}"
									style="font-weight:bold" />

								<h:panelGroup>
									<h:outputText value="Record Date " />
									<h:outputText style="color:red; float: right" value=" : " />
								</h:panelGroup>
								<h:outputText
									value="#{teacherController.teacher.userTeacher.record_date}"
									style="font-weight:bold" />
							</h:panelGrid>
						</p:dialog>
					</h:form>

					<h:form id="formListMyLesson">
						<p:dialog header="My Lesson Dialog" widgetVar="dialogMyLessons"
							modal="true" showEffect="explode" hideEffect="explode"
							width="70%" styleClass="panel_back2">
							<p:dataTable id="listMyLessonDatatable" var="myLessonList" 
								value="#{studentLessonController.getMyLessonList(userLoginBean.user.user_id)}"
								style="width:99%; padding-top: 1px; padding-bottom: 1px;  vertical-align: top;"
								draggableColumns="true" resizableColumns="true">

								<p:column headerText="Student Lesson ID">
									<h:outputText value="#{myLessonList.student.student_id}" />
								</p:column>
								
								<p:column headerText="Lesson Name">
									<h:outputText value="#{myLessonList.teacherLesson.lesson.lesson_name}" />
								</p:column>

							</p:dataTable>
						</p:dialog>
					</h:form>


					<p:dialog header="Information Dialog" widgetVar="basicdialog"
						modal="true">
						<h:outputText value="No any Informa!!!" style="color:red" />
						<br />
						<p:graphicImage value="/resources/img/travel.png" width="600px"
							height="400px" />
					</p:dialog>
				</h:form>
			</ui:insert>
		</p>

	</ui:composition>
</h:body>
</html>
